package cn.doitedu.vueapi.controller.tg;

import cn.doitedu.vueapi.pojo.tg.AdFlowVo;
import cn.doitedu.vueapi.pojo.tg.AdPvs;
import cn.doitedu.vueapi.pojo.tg.FlowResult;
import cn.doitedu.vueapi.service.tg.AdFlowServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.*;

@RestController
public class FlowDataController {

    @Autowired
    AdFlowServiceImpl adFlowService;

    /**
     * 后期优化，现在是从pv记录中，在代码中进行pv总数统计
     * @param uid
     * @return
     */
    @CrossOrigin
    @RequestMapping("/ads/flow")
    public FlowResult<List<AdFlowVo>>  getFlowTable(Integer uid){

        List<AdFlowVo> lst = adFlowService.getFlowDataByUid(uid);

        FlowResult<List<AdFlowVo>> res = new FlowResult<>();
        res.setCode(200);
        res.setMsg("");
        res.setLst(lst);
        return res;
    }


}
